import React from 'react';

import { NavBar } from 'antd-mobile';
import { history } from 'umi'

import icon from '@/pages/Recruitment/External/images/icon-back.png';

import styles from './index.less';

const CustomNavBar = ({ children, onLeftClick, ...rest }) => (
    <NavBar
        className={styles.customNavBar}
        icon={<img src={icon} alt="" width="24" height="24" />}
        mode="light"
        onLeftClick={() => (onLeftClick ? onLeftClick() : history.goBack())}
        {...rest}
    >
        {children}
    </NavBar>
);

export default CustomNavBar;
